package com.mdd.admin.validate.system;

import com.mdd.admin.validate.BaseParam;
import com.mdd.common.validator.annotation.IntegerContains;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SystemRchargeConfingParam extends BaseParam {

    @NotNull(message = "open参数缺失", groups = {BaseParam.create.class, BaseParam.update.class})
    @IntegerContains(values = {0, 1}, message = "open参数值不在符合范围", groups = {BaseParam.create.class, BaseParam.update.class})
    private Integer open;

    @NotNull(message = "最低充值金额参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "最低充值金额不能少于0", groups = {create.class, update.class})
    private BigDecimal minAmount;

}
